<template>
  <!-- 模板内容：只能有一个div  -->
  <div>
    <div class="box">
      <h2>最近流行</h2>
      <div class="content_paging" ref="content">
        <div>
          <div class="box_card" v-for="(item,index) in list" :key="index">
            <img
              :src="item.img"
              alt=""
            />
            <h3>{{item.title}}</h3>
            <span>{{item.state}}</span>
          </div>
          
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  name: "ContentCard",
  data(){
      return{
          list:[]
      }
  },
  methods: {
    async fn_a() {
      let { data } = await axios.get(
        "https://mock.presstime.cn/mock/61bbe55090bfb20016179195/broducttest/shoppingcard"
      );
      (this.list = data.content_menu_card), console.log(data.content_menu_img);
    },
  },
  created() {
    this.fn_a();
  },
};
</script>

<style lang="less" scoped>
.box {
  width: 100%;
  //   height: 500px;
  //   background: red;
  h2 {
    margin: 5px;
    font-size: 20px;
    color: #c07d7d;
    display: inline-block;
  }
  .box_card {
    width: 230px;
    height: 230px;
    border: 1px solid #ccc;
    text-align: center;
    float: left;
    margin-left: 10px;
    margin-top: 10px;

    img {
      width: 230px;
      height: 138px;
    }
    h3 {
        margin-top: 5px;
      font-size: 18px;
    }
    span {
      font-size: 14px;
      margin-top: 8px;
      display: inline-block;
    }
  }
}
</style>